home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: landen.math.uwaterloo.ca!tthiraku
- From: tthiraku@landen.math.uwaterloo.ca (Thanou Thirakul)
- Subject: [] overload..(newbie in distress)
- Sender: news@undergrad.math.uwaterloo.ca (news spool owner)
- Message-ID: <DLGppJ.31C@undergrad.math.uwaterloo.ca>
- Date: Sat, 20 Jan 1996 04:27:19 GMT
- Nntp-Posting-Host: landen.math.uwaterloo.ca
- Organization: University of Waterloo
-
- Hi..
-
- I'm currently stuck on how to overload [] operator such that
- it does two different tasks..
-
-
- case 1:
-
- // A is an instance of a class that contains a linkist.
-
- A[5] = val; // store val into the fifth node of a linklist.
- val = A[5] ; // returns the value of the fifth node of a linklist.
-
-
- I was wondering how can C++ differentiate these two senerios?
-
- Anything help will greatly appreciated..
-
- Thank You Kindly
- --
- Thanou Thirakul
- tthiraku@undergrad.math.uwaterloo.ca
- http://www.undergrad.math.uwaterloo.ca/~tthiraku
- ___________________________________________________________
- | |
- | <after submitting a CS assignment> |
- | |
- | "Well, that was the most well-documented non-working |
- | piece of code I have ever written.. " -unknown |
- | |
- |___________________________________________________________|
-